Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/big.js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/big.js

TypeScript definitions for big.js

  • 4.0.5
  • ts2.0
  • ts2.1
  • ts2.2
  • ts2.3
  • ts2.4
  • ts2.5
  • ts2.6
  • ts2.7
  • ts2.8
  • ts2.9
  • ts3.0
  • ts3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
714K
decreased by-5.06%
Maintainers
1
Weekly downloads
 
Created

What is @types/big.js?

@types/big.js provides TypeScript type definitions for the big.js library, which is used for arbitrary-precision decimal arithmetic in JavaScript.

What are @types/big.js's main functionalities?

Basic Arithmetic Operations

This feature allows you to perform basic arithmetic operations such as addition, subtraction, multiplication, and division with arbitrary precision.

const Big = require('big.js');
const a = new Big(0.1);
const b = new Big(0.2);
const sum = a.plus(b); // 0.3
const difference = a.minus(b); // -0.1
const product = a.times(b); // 0.02
const quotient = a.div(b); // 0.5

Comparison Operations

This feature allows you to compare two Big numbers using methods like eq (equal), gt (greater than), and lt (less than).

const Big = require('big.js');
const a = new Big(0.1);
const b = new Big(0.2);
const isEqual = a.eq(b); // false
const isGreaterThan = a.gt(b); // false
const isLessThan = a.lt(b); // true

Rounding

This feature allows you to round a Big number to a specified number of decimal places.

const Big = require('big.js');
const a = new Big(1.2345);
const rounded = a.round(2); // 1.23

Conversion to String

This feature allows you to convert a Big number to a string representation.

const Big = require('big.js');
const a = new Big(1.2345);
const str = a.toString(); // '1.2345'

Other packages similar to @types/big.js

FAQs

Package last updated on 30 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc